#!/bin/bash
OK=0
WARN=1
CRITICAL=2
UNKNOWN=3
PATH="/bin:/sbin:/usr/bin:/usr/sbin"
if [ -f /usr/lib64/nagios/plugins/check_diskw.sh ]
then
        if [ -w  /usr/lib64/nagios/plugins/check_diskw.sh ]
        then
                echo " local disk and can write"
                exit $OK
        else
                echo "disk only read"
                exit $CRITICAL
        fi
elif [ -f /usr/lib64/nagios/plugins/check_diskw.sh ]
then
        if [ -w  /usr/lib64/nagios/plugins/check_diskw.sh ]
        then
                echo " local disk and can write"
                exit $OK
        else
                echo "disk only read"
                exit $CRITICAL
        fi
else
        echo "File dosn't exist to check"
        exit $WARN
fi
